import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)

const actions = {
	updateUserInfo(context, value) {
		context.commit('UPDATEUSERINFO', value)
	}
}

const mutations = {
	UPDATEUSERINFO(state, value) {
		state.userInfo = value
	}
}

const state = {
	// userInfo: {
	// 	nickname: "橙猫猫",
	// 	avatarUrl: "https://tupian.qqw21.com/article/UploadPic/2020-1/20201122246510666.jpg",
	// 	gender: 1,
	// },
	userInfo: {
		userName: '',
		userId: '',
		avatar: '',
		nickname: '',
		author: 'user'
	}
}

const getters = {

}

export default new Vuex.Store({
	actions,
	mutations,
	state,
	getters
})
